<include file="/public/header" />
<!-- // 重定位style -->
<link href="__STATICADMIN__css/content.css?" rel="stylesheet" type="text/css" />
<div class="layui-fluid">
    <form class="layui-form layui-card" >

        <div class="layui-card-body">
        <gt name="$data.id" value="0">
            <input type="text" name="id" value="{$data.id}" hidden="">
            <else/>
            <input type="text" name="id" value="" hidden="">
        </gt>
        
            <div class="layui-tab layui-tab-brief"  >
                <ul class="layui-tab-title">
                  <li class="layui-this">{:__('常规选项')}</li>
                  <li>{:__('高级选项')}</li>
                  <li>{:__('栏目内容')}</li>
                </ul>
                <div class="layui-tab-content" >
                    <div class="layui-tab-item layui-show">
                        <div class="layui-fl">
                            <div class="layui-form-item"> 
                                <label class="layui-form-label">{:__('栏目模型')}</label>
                                <div class="layui-input-inline">
                                    <select name="cid"  lay-verify="required" >
                                        <option value="">{:__('请选择模型')}</option>
                                        <salibs:channel id="vo">
                                            <option value="{$vo.id}" <if condition="$vo['id'] eq $data['cid']"> selected </if> >{$vo.title}</option>
                                        </salibs:channel>
                                    </select>
                                </div>
                            </div> 
                            <div class="layui-form-item"> 
                                <label class="layui-form-label">{:__('栏目分类')}</label>
                                <div class="layui-input-inline">
                                    <div id="pid"></div>
                                </div>
                            </div>
                            <div class="layui-form-item"> 
                                <label class="layui-form-label">{:__('栏目名称')}</label>
                                <div class="layui-input-inline">
                                    <input name="title"  type="text" class="layui-input" value="{$data.title}"  lay-verify="required"
                                     placeholder="{:__('请填写栏目名称')}"/>
                                </div>
                            </div>
                        </div>

                        <div class="layui-fl">

                            <div class="layui-form-item"> 
                                <label class="layui-form-label">{:__('排&emsp;序')}</label>
                                <div class="layui-input-inline">
                                    <input name="sort" type="number" class="layui-input" value="{$data.sort}" placeholder="{:__('默认生成')}" />
                                </div>
                            </div>   
                            <div class="layui-form-item"> 
                                <label class="layui-form-label">{:__('权&emsp;限' )}</label>
                                <div class="layui-input-inline">
                                    <div id="access"></div>
                                </div>
                            </div>
                            <div class="layui-form-item"> 
                                <label class="layui-form-label">{:__('拼&emsp;音')}</label>
                                <div class="layui-input-inline">
                                    <input name="pinyin"  type="text" class="layui-input" value="{$data.pinyin}" placeholder="{:__('默认生成')}" />
                                </div>  
                            </div>
                        </div>


                        <div class="layui-form-item"> 
                            <label class="layui-form-label">{:__('栏目图片')}</label>
                            <div class="layui-input-inline wid650" >
                                <input name="image" type="text" class="layui-input pic" value="{$data.image}" placeholder="请上传或直接粘贴图片地址"/>
                            </div>
                            <button type="button" class="layui-btn layui-btn-normal" lay-upload="" lay-input="pic">{:__('上传图片')}</button>
                        </div>
                        <div class="layui-form-item"> 
                                <label class="layui-form-label">{:__('标&emsp;题')}</label>
                                <div class="layui-input-inline wid650">
                                    <input name="seo_title" type="text" class="layui-input" value="{$data.seo_title}"  placeholder="{:__('请填写SEO标题')}" />
                                </div>
                            </div>
                        <div class="layui-form-item"> 
                            <label class="layui-form-label">{:__('关键字')}</label>
                            <div class="layui-input-inline wid650">
                                <input name="seo_words" type="text" class="layui-input" value="{$data.seo_keywords}" placeholder="{:__('请填写SEO关键字')}"/>
                            </div>
                        </div>

                        <div class="layui-form-item"> 
                            <label class="layui-form-label">{:__('描&emsp;述')}</label>
                            <div class="layui-input-inline wid650">
                                <textarea  name="seo_description" style="height: 50px;" class="layui-textarea" placeholder="{:__('请填写SEO描述信息')}" >{$data.seo_description}</textarea>
                            </div>
                        </div>

                        <div class="layui-form-item"> 
                            <label class="layui-form-label">{:__('跳转网址')}</label>
                            <div class="layui-input-inline wid650">
                                <input name="jumpurl" type="text" class="layui-input" value="{$data.jumpurl}" placeholder="http://"/>
                            </div>
                        </div>  
                    </div>

                    <div class="layui-tab-item">

                        <div class="layui-form-item">
                            <label class="layui-form-label" >{:__('投稿选项')}</label>
                            <div class="layui-input-inline" >
                                 <input type="radio" name="contribute"   
                                 value="1" title="是"  <if condition="$data.contribute eq 1 "> checked </if> >
                                 <input type="radio" name="contribute"   
                                 value="0" title="否" <if condition="$data.contribute eq 0 "> checked </if> >
                            </div>   
                            <div class="layui-form-mid layui-word-aux">* {:__('是否开启会员投稿支持！')}</div>                
                        </div> 

                        <div class="layui-form-item">
                            <label class="layui-form-label" >{:__('是否单页面')}</label>
                            <div class="layui-input-inline" >
                                 <input type="radio" name="single"   
                                 value="1" title="是"  <if condition="$data.single eq 1 "> checked </if> >
                                 <input type="radio" name="single"   
                                 value="0" title="否" <if condition="$data.single eq 0 "> checked </if> >
                            </div>   
                            <div class="layui-form-mid layui-word-aux">* {:__('当前栏目是否为单页面形式')}</div>                
                        </div> 

                        <div class="layui-form-item">
                            <label class="layui-form-label">{:__('独立模板')}</label>
                            <div class="layui-input-inline">
                                <select name="skin">
                                    <option value=""></option>
                                    <volist name="skin" id="vo">
                                        <option value="{$vo}" <if condition="$vo eq $data['skin']"> selected </if> >{$vo}</option>
                                    </volist>
                                </select>
                            </div>
                            <div class="layui-form-mid layui-word-aux" style="color: red!important;">* {:__('自定义模板请在app/index/view/cagetory编写')}</div> 
                        </div>  

                    </div>

                    <div class="layui-tab-item">
                        <blockquote class="layui-elem-quote">说明：栏目内容是替代原来栏目单页模型的一种灵活方式，可在模板中使用标签调用内容，通常用户企业简介等！</blockquote>
                        <textarea id="content" name="content" />{$data.content}</textarea>
                    </div>
              </div>
          </div>
          </div>
    
        <div class="layui-footer layui-form-footer">
            <button class="layui-btn layui-btn-primary" type="button" sa-event="closeDialog">{:__('取消')}</button>
            <button class="layui-btn" lay-filter="submitIframe" lay-submit>{:__('提交')}</button>
        </div>
    </form>
</div>
<include file="/public/footer" />
<script src="__STATICADMIN__module/xmselect/xmselect.js"></script>
<script src="/static/js/tinymce/tinymce.min.js"></script>
<script>
    var grouplist = {:get_usergroup_json()};
    var categorylist = {:get_category_json()};  
</script>
<script>
    layui.use(['content'],function () {
        
        var content = layui.content;
        // 常规元素渲染
        content.tinymce('content');
        content.xmselect('access',grouplist,[{$data.access}]);
        content.xmselect('pid',categorylist,[{$data.pid}],false);
    });
</script>